﻿<UserControl x:Class="Mengsk.ERP.App.Refused.RefusedUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="1000" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Margin="3" Orientation="Horizontal">
            <TextBlock Text="运单号码" Margin="3" VerticalAlignment="Center"/>
            <TextBox Margin="3" Name="tbDeliveryNumber" VerticalAlignment="Center" Width="100" KeyDown="tbDeliveryNumber_KeyDown" GotFocus="tbDeliveryNumber_GotFocus"/>
            <CheckBox Name="cbAppendD" Content="自动添加D" Margin="3" VerticalAlignment="Center"/>
            <CheckBox Name="cbGetLast" Content="从网络获取最新状态" Margin="3" VerticalAlignment="Center" IsChecked="True"/>
            <DatePicker Name="dpDate" Margin="3" VerticalAlignment="Center"/>
            <Button Name="btnMakeReturn" Content="标记收到" Margin="3" VerticalAlignment="Center" Width="60" Click="btnMakeReturn_Click"/>
            <Button Name="btnClear" Content="清空" Margin="3" VerticalAlignment="Center"  Width="60" Click="btnClear_Click"/>
            <Button Name="btnImport" Content="导入" Margin="3" VerticalAlignment="Center" Width="60" Click="btnImport_Click"/>
        </StackPanel>

        <TextBlock Text="当前共" Margin="3" Grid.Row="1" FontSize="16" Name="tbCount"/>

        <DataGrid Margin="3" Grid.Row="2" Name="dgvOrders" AutoGenerateColumns="False" SelectionMode="Extended" SelectionUnit="CellOrRowHeader">
            <DataGrid.Columns>
                <DataGridTextColumn Header="店铺名称" Width="Auto" Binding="{Binding Path=Source.Shop}" IsReadOnly="True"/>
                <DataGridTextColumn Header="购买用户" Width="Auto" Binding="{Binding Path=Source.Name}" IsReadOnly="True"/>
                <DataGridTextColumn Header="商品名称" Width="Auto" Binding="{Binding Path=Source.InternalName}" IsReadOnly="True"/>
                <DataGridTextColumn Header="商品颜色" Width="Auto" Binding="{Binding Path=Source.Color}" IsReadOnly="True"/>
                <DataGridTextColumn Header="商品尺码" Width="Auto" Binding="{Binding Path=Source.Size}" IsReadOnly="True"/>
                <DataGridTextColumn Header="订单状态" Width="Auto" Binding="{Binding Path=SourceOrder.State}" IsReadOnly="True"/>
                <DataGridTextColumn Header="物流公司" Width="Auto" Binding="{Binding Path=Source.DeliveryCompany}" IsReadOnly="True"/>
                <DataGridTextColumn Header="物流编号" Width="Auto" Binding="{Binding Path=Source.DeliveryNumber}" IsReadOnly="True"/>
                <DataGridTextColumn Header="处理状态" Width="Auto" Binding="{Binding Path=State}" IsReadOnly="True"/>
                <DataGridHyperlinkColumn Header="删除" Width="Auto" Binding="{Binding Path=Action}">
                    <DataGridHyperlinkColumn.ElementStyle>
                        <Style>
                            <EventSetter Event="Hyperlink.Click" Handler="DeleteOrder_Click"/>
                        </Style>
                    </DataGridHyperlinkColumn.ElementStyle>
                </DataGridHyperlinkColumn>
                <DataGridTextColumn Header="订单描述" Width="Auto" Binding="{Binding Path=SellerComment}"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
